Skip to content

feat(ci): add GitHub Action for Python tests, fix EarlyStopping logic, and add unit tests #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Oct 15, 2024

Conversation

Bjarten
Copy link
Owner

@Bjarten Bjarten commented Oct 15, 2024

This PR introduces several key changes:

  1. A GitHub Actions workflow for continuous integration, running tests across multiple Python versions.
  2. Fixes to the EarlyStopping class logic, changing best_score to best_val_loss to improve clarity and correctness.
  3. A new test suite for the EarlyStopping class to ensure its correct behavior after the logic fix.

Changes:

  • Added Python application tests:

    • A new workflow named "Python Application Tests" runs on GitHub Actions.
    • Tests are executed across multiple Python versions (3.9, 3.10, 3.11, 3.12).
    • The workflow is triggered on pushes and pull requests to the main branch.
    • Pip dependencies are cached to optimize performance.
  • Fixed EarlyStopping logic:

    • The variable best_score was renamed to best_val_loss for clarity, improving the code's readability and matching the purpose of the variable.
    • Logic for early stopping was updated to properly handle edge cases for delta and stopping conditions based on validation loss behavior.
  • Added Unit Tests for EarlyStopping:

    • The file test_early_stopping.py contains a thorough set of tests covering:
      • Initialization and attribute checks.
      • Behavior when validation loss improves.
      • Handling when validation loss does not improve.
      • Proper functionality of patience and delta parameters.
      • Edge cases for early stopping triggers and verbose output.

Why this change is important:

  • Automates testing across different Python versions to ensure compatibility and reliability.
  • Fixes logic issues in the EarlyStopping class, making it more robust and clear.
  • Ensures the EarlyStopping class functions as expected through the added unit tests.
  • Improves development velocity by automatically running tests on every push and pull request.

@Bjarten Bjarten changed the title feat(ci): add GitHub Action for Python application tests feat(ci): add GitHub Action for Python tests and unit tests for early stopping Oct 15, 2024
@Bjarten Bjarten changed the title feat(ci): add GitHub Action for Python tests and unit tests for early stopping feat(ci): add GitHub Action for Python tests, fix EarlyStopping logic, and add unit tests Oct 15, 2024
@Bjarten Bjarten merged commit ffe12ee into main Oct 15, 2024
5 checks passed
@Bjarten Bjarten deleted the ci/testing branch October 15, 2024 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant